import { post } from '@/utils/request'

/**
 * 流程详情
 * @param id
 * @returns {*}
 */
export function fetchDetail(id) {
  return post('/api/flowable/model/detail', { id: id })
}

/**
 * 新建流程初始化流程信息
 * @param id
 * @returns {*}
 */
export function initFlowDetail(id) {
  return post('/api/flowable/model/initFlowDetail', { id: id })
}

/**
 * 流程详情
 * @param workId
 * @returns {*}
 */
export function fetchWorkFlowDetail(id) {
  return post('/api/workflow/detail', { id: id })
}

/**
 * 预览流程图详情
 * @param workId
 * @returns {*}
 */
export function viewWorkFlowImg(id) {
  return post('/api/workflow/viewWorkFlowImg', { id: id })
}

/**
 * 保存
 * @param data
 */
export function saveData(data) {
  return post('/api/flowable/model/save', data)
}

/**
 * 删除
 * @param data
 */
export function deleteById(id) {
  return post('/api/flowable/model/delete', { ids: [id] })
}

/**
 *分页查询
 * @param data
 */
export function paging(data) {
  return post('/api/flowable/model/paging', data)
}

/**
 * 发布流程
 * @param data
 */
export function fbFlow(id) {
  return post('/api/flowable/model/fbFlow', { id: id })
}

/**
 * 启动流程
 * @param data
 */
export function startFlow(data) {
  return post('/api/workflow/startFlow', data)
}

/**
 * 获取流程节点
 * @param data
 */
export function getBackWorkFlowNodes(id) {
  return post('/api/workflow/getBackWorkFlowNodes', { id: id })
}

/**
 * 流程选择用户
 * @param data
 */
export function selectUsers() {
  return post('/api/sys/user/paging', {
    current: 1,
    size: 10000,
    params: {
    }
  })
}

